import React from 'react';
import { Router, Route, Switch } from 'dva/router';
import WeChatPage from './routes/WeChatPage';
import AliPayPage from './routes/AliPayPage';
import EmptyPage from './routes/EmptyPage';
import SuccessPage from './routes/SuccessPage';
import HomePage from './routes/HomePage';
import { index } from './routes/IndexPage';

function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Switch>
        <Route path="/Index" exact component={index(EmptyPage, '')} />
        <Route path="/WC" exact component={index(WeChatPage, 'WC')} />
        <Route path="/AP" exact component={index(AliPayPage, 'AP')} />
        <Route path="/Success" exact component={SuccessPage} />
        <Route path="/Home" exact component={HomePage} />
      </Switch>
    </Router>
  );
}

export default RouterConfig;
